package com.kefu.chat.vo;

import java.util.List;

import javax.validation.constraints.NotEmpty;

import cn.hutool.core.bean.BeanUtil;
import com.kefu.chat.model.ChatEvaluate;
import com.kefu.chat.model.ChatEvaluateRel;
import com.kefu.common.context.KefuContext;
import com.kefu.common.vo.AbstractUpdateVo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

/**
 * @author CodeGenerator
 * @date 2021/11/23
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@ApiModel(description = "在线评价设置")
public class ChatEvaluateUpdateVo extends AbstractUpdateVo<ChatEvaluate,String> {
    @NotEmpty
    @ApiModelProperty(value = "主键")
    private String id;
    @NotEmpty
    @ApiModelProperty(value = "渠道id")
    private String channelId;
    @ApiModelProperty(value = "人工客服是否解决问题 0=否，1=是")
    private Integer evaluateAdminSolve;
    @ApiModelProperty(value = "评价标签库，内容逗号分隔")
    private String evaluateAdminTag;
    @ApiModelProperty(value = "评价模式 1=五星模式，2=10分模式")
    private Integer evaluateModel;
    @ApiModelProperty(value = "默认显示 1=五星，2=0星，3=10分，4=5分，5=0分")
    private Integer defaultStarShowModel;
    @ApiModelProperty(value = "默认显示 1=10分，2=4-5分，3=0分")
    private Integer defaultScoreShowModel;
    @ApiModelProperty(value = "星星列表")
    private List<ChatEvaluateRel> starList;
    @ApiModelProperty(value = "分数列表")
    private List<ChatEvaluateRel> scoreList;

    @Override
    public ChatEvaluate convert() {
        KefuContext context = KefuContext.getKefuContext();
        ChatEvaluate info = BeanUtil.toBean(this, ChatEvaluate.class);
        info.setUpdateUser(context.getUserId());
        info.setUpdateTime(context.getNow());
        info.setUpdateName(context.getUserName());
        return info;
	}
}